package com.dapeng.cleardatabackend.model.dto.relation;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * @author dapeng
 * @description 新增关系请求
 * @date 2024/12/27 16:50
 */
@Data
@ApiModel(description = "新增关系请求")
public class RelationAddRequest implements Serializable {

    private static final long serialVersionUID = 431319699180079952L;

    /**
     * 图谱id
     */
    @ApiModelProperty(value = "图谱id", required = true)
    @NotNull(message = "图谱id不能为空")
    @Min(value = 1, message = "图谱id不能小于1")
    private Long graphId;

    /**
     * 前键id
     */
    @ApiModelProperty(value = "前键id", required = true)
    @NotNull(message = "前键id不能为空")
    @Min(value = 1, message = "前键id不能小于1")
    private Long startId;

    /**
     * 关系
     */
    @ApiModelProperty(value = "关系")
    @NotBlank(message = "关系不能为空")
    @Size(min = 1, max = 500, message = "关系长度应该在1-500之间")
    private String relationText;

    /**
     * 后键id
     */
    @ApiModelProperty(value = "后键id", required = true)
    @NotNull(message = "后键id不能为空")
    @Min(value = 1, message = "后键id不能小于1")
    private Long endId;

}
